<?php

/**
 * Description of Array
 *
 * @author polacseka
 */
class x10_Util_Array
{
	public static function collectionColumnAsList($data, $column)
	{
		$result = array();
		if (isset($data) and isset($data[0]) and is_array($data[0]))
		{
			foreach ($data as $row)
			{
				if (isset($row[$column])) $result[] = $row[$column];
			}
		}
		else if (isset($data) and isset($data[0]) and is_object($data[0]))
		{
			foreach ($data as $row)
			{
				if (isset($row->$column)) $result[] = $row->$column;
			}
		}
		return $result;
	}
}

?>